home *** CD-ROM | disk | FTP | other *** search
/ Workbench Add-On / Workbench Add-On - Volume 1.iso / Dev / Oberon / source / amiga / Disk.mod < prev    next >
Text File  |  1995-06-29  |  4KB  |  149 lines

  1. (***************************************************************************
  2.  
  3.      $RCSfile: Disk.mod $
  4.   Description: Interface to disk.resource
  5.  
  6.    Created by: fjc (Frank Copeland)
  7.     $Revision: 3.8 $
  8.       $Author: fjc $
  9.         $Date: 1995/06/04 23:13:14 $
  10.  
  11.   Includes Release 40.15
  12.  
  13.   (C) Copyright 1985-1993 Commodore-Amiga, Inc.
  14.       All Rights Reserved
  15.  
  16.   Oberon-A interface Copyright © 1994-1995, Frank Copeland.
  17.   This file is part of the Oberon-A Interface.
  18.   See Oberon-A.doc for conditions of use and distribution.
  19.  
  20. ***************************************************************************)
  21.  
  22. <* STANDARD- *>
  23.  
  24. MODULE [2] Disk;
  25.  
  26. IMPORT e := Exec, s := Sets;
  27.  
  28.  
  29. (*
  30. **      $VER: disk.h 27.11 (21.11.90)
  31. **
  32. **      disk.h -- external declarations for the disk resource
  33. *)
  34.  
  35.  
  36. (********************************************************************
  37. *
  38. * Resource structures
  39. *
  40. ********************************************************************)
  41.  
  42.  
  43. TYPE
  44.  
  45.   DiscResourceUnitPtr * = POINTER TO DiscResourceUnit;
  46.   DiscResourceUnit * = RECORD (e.MessageBase)
  47.     message *   : e.Message;
  48.     discBlock * : e.Interrupt;
  49.     discSync *  : e.Interrupt;
  50.     index *     : e.Interrupt;
  51.   END; (* DiscResourceUnit *)
  52.  
  53.   DiscResourcePtr * = POINTER TO DiscResource;
  54.   DiscResource * = RECORD (e.LibraryBase)
  55.     library *     : e.Library;
  56.     current *     : DiscResourceUnitPtr;
  57.     flags *       : s.SET8;
  58.     pad *         : e.UBYTE;
  59.     sysLib *      : e.LibraryPtr;
  60.     ciaResource * : e.LibraryPtr;
  61.     unitID *      : ARRAY 4 OF e.ULONG;
  62.     waiting *     : e.List;
  63.     discBlock *   : e.Interrupt;
  64.     discSync *    : e.Interrupt;
  65.     index *       : e.Interrupt;
  66.     currTask *    : e.TaskPtr;
  67.   END; (* DiscResource *)
  68.  
  69. CONST
  70.  
  71. (* DiscResource.drFlags entries *)
  72.   alloc0      * = 0;       (* unit zero is allocated *)
  73.   alloc1      * = 1;       (* unit one is allocated *)
  74.   alloc2      * = 2;       (* unit two is allocated *)
  75.   alloc3      * = 3;       (* unit three is allocated *)
  76.   active      * = 7;       (* is the disc currently busy? *)
  77.  
  78.  
  79. (********************************************************************
  80. *
  81. * Hardware Magic
  82. *
  83. ********************************************************************)
  84.  
  85. CONST
  86.  
  87.   dskDMAOff       * = 4000H;  (* idle command for dsklen register *)
  88.  
  89.  
  90. (********************************************************************
  91. *
  92. * Resource specific commands
  93. *
  94. ********************************************************************)
  95.  
  96. CONST
  97.  
  98.   diskName * = "disk.resource";
  99.  
  100. (********************************************************************
  101. *
  102. * drive types
  103. *
  104. ********************************************************************)
  105.  
  106. CONST
  107.  
  108.   amiga       * = 00000000H;
  109.   drt37422D2S * = 55555555H;
  110.   empty       * = 0FFFFFFFFH;
  111.   drt150RPM   * = 0AAAAAAAAH;
  112.  
  113.  
  114. (**-- Resource Base variable --------------------------------------------*)
  115.  
  116.  
  117. VAR
  118.  
  119.   base * : DiscResourcePtr;
  120.  
  121.  
  122. (**-- Resource Functions ------------------------------------------------*)
  123.  
  124. (*
  125. **      $VER: disk_protos.h 36.1 (19.2.91)
  126. *)
  127.  
  128. PROCEDURE AllocUnit* [base,-6]
  129.   ( unitNum [0] : LONGINT )
  130.   : BOOLEAN;
  131. PROCEDURE FreeUnit* [base,-12]
  132.   ( unitNum [0] : LONGINT );
  133. PROCEDURE GetUnit* [base,-18]
  134.   ( unitPointer [8] : DiscResourceUnitPtr )
  135.   : DiscResourceUnitPtr;
  136. PROCEDURE GiveUnit* [base,-24] ();
  137. PROCEDURE GetUnitID* [base,-30]
  138.   ( unitNum [0] : LONGINT )
  139.   : LONGINT;
  140.  
  141. (* ------ new for V37 ------*)
  142.  
  143. PROCEDURE ReadUnitID* [base,-36]
  144.   ( unitNum [0] : LONGINT )
  145.   : LONGINT;
  146.  
  147. BEGIN base := NIL
  148. END Disk.
  149.